package com.sl.au.repository;

import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


import com.sl.au.entity.EventTask;;

public interface EventTaskRepository  extends JpaRepository<EventTask, String>{
	@Query("select a from EventTask a where a.eventId=?1")
	List<EventTask> getTaskByEventId(String eventId);
	
	
	@Query("select a from EventTask a where a.eventId=?1 order by a.eventTaskTime desc")
	List<EventTask> getNewestTaskByEventId(String eventId);

	@Query("select a from EventTask a where a.eventId=?1 and a.photoUrl is not null order by a.eventTaskTime asc")
	List<EventTask> getTaskPicByEventId(String eventId);
}
